import request from '../utils/httpRequest';
//获取商品明细
export const goodsDetail = (id) => {
    return request.get({
        url: `/app-api/product/spu/get-detail?id=${id}`,
    });
};
// 获取商品评价
export const commentPage = (spuId, type, pageNo, pageSize) => {
    return request.get({
        url: `/app-api/product/comment/page?spuId=${spuId}&type=${type}&pageNo=${pageNo}&pageSize=${pageSize}`,
    });
};
// 添加购物车
export const addCart = (data) => {
    return request.post({
        url: '/app-api/trade/cart/add',
        data
    });
};
// 获得商品 SPU 分页
export const spuPage = (query) => {
    return request.get({
        url: `/app-api/product/spu/page${query}`,
    });
};
// 商品数量
export const cartCount = () => {
    return request.get({
        url: '/app-api/trade/cart/get-count',
        loginType: true
    });
};
// 创建订单
export const settlementorder = (data) => {
    return request.post({
        url: '/app-api/trade/order/settlement',
        data
    });
};